﻿#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_optodemo.h"
#include <QTimer>
#include <QSettings>    //for ini

#include <filesystem>

#include "opto_framework.hpp"
#include "opto_devices_manager.hpp"
#include "opto_module.hpp"
#include "opto_image.hpp"
#include "opto_display.hpp"

#pragma execution_character_set("utf-8")
#pragma warning(disable:4996)
using std::filesystem::path;

QT_BEGIN_NAMESPACE
namespace Ui { class OptoDemoClass; };
QT_END_NAMESPACE

class OptoDemo : public QMainWindow
{
    Q_OBJECT

public:
    OptoDemo(QWidget *parent = nullptr);
    ~OptoDemo();

    void onTimeout();
    void work();
    void runFuc();

private:
    Ui::OptoDemoClass *ui;
    //ini配置内容
    QSettings* settings;
    std::string camera;
    int time;
    int Ring_Power, Coax_Power, Red, Green, Blue;
    double Ring_ExposureTime, Coax_ExposureTime;

    Opto::DisplayWindow window;
    Opto::Image image;

    QTimer* timer;
    bool flag;
    bool toShow;        //切换完，再展示。防止灯闪烁时屏幕画面也闪

    Opto::Module module;
};
